<%@ page language="java" pageEncoding="UTF-8" buffer="16kb"%>
<%@ include file="/base.jsp"%>
<%@ include file="/module/taglibs.jsp"%>
<%@ include file="/module/nocache.jsp"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8" />
<%@ include file="/module/js.jsp"%>
<script>
	$(document)
			.ready(
					function() {
						var _form = $("#scholarshipForm").validate();
						//返回
						$('#btnBack')
								.click(
										function() {
											document.scholarshipForm.action = "${basePath}/scholarship/scholarshipStudentCheckIndex";
											document.scholarshipForm
													.submit();

										});
						//保存
						$("#btnSave").click(function() {
							//if (_form.form()) {
							layer.confirm("您是否确定审核吗?", {
								icon : 3,
								title : '提示',
								skin : 'layer-ext-moon'
							}, function(index) {
								valdateScholarship();
							}, function(index) {
								layer.close(index);
							});

							//}
						});
					});
	//验证学生申请奖学金是否条件
	function valdateScholarship() {
		var states = $("#states").val();
		if (states == 3) {
			$
					.ajax({
						type : "post",
						url : "${basePath}/scholarship/valdateStudentScholarship",
						data : {
							xsid : "${scholarshipApply.stuid}",
							xnd : "${scholarshipApply.xnd}",
							jxjdj : "${scholarshipApply.jxjdj}"
						},
						success : function(data) {
							if (data == "1") { //符合条件
								document.scholarshipForm.action = "${basePath}/scholarship/auditStudentScholarship";
								document.scholarshipForm.submit();
							} else { //不符合条件
								layer.alert("该学生不符合申请奖学金条件，不能审核通过", {
									icon : 6
								});
								return false;
							}
						}
					});
		} else {
			document.scholarshipForm.action = "${basePath}/scholarship/auditStudentScholarship";
			document.scholarshipForm.submit();
		}
	}
</script>
</head>
<body style="height: 100%">
	<form action="#" id="scholarshipForm" name="scholarshipForm">
		<input type="hidden" id="sqid" name="sqid"
			value="${scholarshipApply.sqid}" /> <input type="hidden" id="reId"
			name="reId" value="${reId}" />
		<div id="view">
			<table cellpadding="0" cellspacing="0" border="0"
				class="table-border" width="95%">
				<tr>
					<td class="table-header" colspan="6">奖学金申请审批</td>
				</tr>
				<tr>
					<td class="table-titleTD" style="width: 12%;">姓名：</td>
					<td class="table-contentTD" style="width: 21%">${scholarshipApply.xm}</td>
					<td class="table-titleTD" style="width: 12%">学号：</td>
					<td class="table-contentTD" style="width: 21%">${scholarshipApply.xh}</td>
					<td class="table-titleTD" style="width: 12%">性别：</td>
					<td class="table-contentTD" style="width: 22%">${scholarshipApply.xb}</td>
				</tr>
				<tr>
					<td class="table-titleTD" style="width: 12%">班级：</td>
					<td class="table-contentTD" style="width: 22%">${scholarshipApply.bjmc}</td>
					<td class="table-titleTD" style="width: 12%">专业：</td>
					<td class="table-contentTD" style="width: 22%">${scholarshipApply.zymc}</td>
					<td class="table-titleTD" style="width: 12%">年级：</td>
					<td class="table-contentTD" style="width: 22%">${scholarshipApply.njmc}</td>
				</tr>
				<tr>
					<td class="table-titleTD" style="width: 12%">民族：</td>
					<td class="table-contentTD" style="width: 22%">${scholarshipApply.mz}</td>
					<td class="table-titleTD" style="width: 12%">身份证件号码：</td>
					<td class="table-contentTD" style="width: 22%">${scholarshipApply.sfzh}</td>
					<td class="table-titleTD" style="width: 12%">出身日期：</td>
					<td class="table-contentTD" style="width: 22%"><fmt:formatDate
							value="${scholarshipApply.csrq}" pattern="yyyy-MM-dd" /></td>
				</tr>
				<tr>
					<td class="table-titleTD" style="width: 12%">政治面貌：</td>
					<td class="table-contentTD" style="width: 22%">${scholarshipApply.zzmm}</td>
					<td class="table-titleTD" style="width: 12%">家庭地址：</td>
					<td class="table-contentTD" style="width: 22%">${scholarshipApply.jtdz}</td>
					<td class="table-titleTD" style="width: 12%">邮政编码：</td>
					<td class="table-contentTD" style="width: 22%">${scholarshipApply.yzbm}</td>
				</tr>
				<tr>
					<td class="table-titleTD" style="width: 12%">学年：</td>
					<td class="table-contentTD" style="width: 22%">${scholarshipApply.xnd}</td>
					<td class="table-titleTD" style="width: 12%">奖学金等级：</td>
					<td class="table-contentTD" style="width: 22%"><c:choose>
							<c:when test="${scholarshipApply.jxjdj==1}">
								<input type="radio" value="1" disabled="disabled"
									checked="checked" />1&nbsp;&nbsp;<input type="radio" value="2"
									disabled="disabled" />2&nbsp;&nbsp;<input type="radio"
									value="3" disabled="disabled" />3
				  </c:when>
							<c:when test="${scholarshipApply.jxjdj==2}">
								<input type="radio" value="1" />1&nbsp;&nbsp;<input type="radio"
									value="2" disabled="disabled" checked="checked"
									disabled="disabled" />2&nbsp;&nbsp;<input type="radio"
									value="3" disabled="disabled" />3
				  </c:when>
							<c:when test="${scholarshipApply.jxjdj==3}">
								<input type="radio" value="1" disabled="disabled" />1&nbsp;&nbsp;<input type="radio" value="2"
									disabled="disabled" />2&nbsp;&nbsp;<input type="radio"
									value="3" disabled="disabled" checked="checked"
									disabled="disabled" />3
				  </c:when>
							<c:otherwise>
								<input type="radio" value="1" disabled="disabled" />1&nbsp;&nbsp;<input
									type="radio" value="2" disabled="disabled" />2&nbsp;&nbsp;<input
									type="radio" value="3" disabled="disabled" />3
				  </c:otherwise>
						</c:choose></td>
					<td class="table-titleTD" style="width: 12%">状态：</td>
					<td class="table-contentTD" style="width: 22%"><c:choose>
							<c:when test="${scholarshipApply.states==0}">
				  未提交				 
				 </c:when>
							<c:when test="${scholarshipApply.states==1}">
				审核退回			 
				 </c:when>
							<c:when test="${scholarshipApply.states==2}">
				审核中			 
				 </c:when>
							<c:when test="${scholarshipApply.states==3}">
				审核通过			 
				 </c:when>
							<c:when test="${scholarshipApply.states==8}">
				退回并结束		 
				 </c:when>
							<c:when test="${scholarshipApply.states==9}">
				撤回	 
				 </c:when>
						</c:choose></td>
				</tr>
				<tr>
					<td class="table-titleTD">家庭成员：</td>
					<td colspan="5"><%@ include file="/module/studentFamily.jsp"%>
					</td>
				</tr>
				<tr>
					<td class="table-titleTD" style="width: 12%">第一学期操行评定等级</td>
					<td class="table-contentTD" style="width: 22%">${cxGrade1}</td>
					<td class="table-titleTD" style="width: 12%">第二学期操行评定等级</td>
					<td class="table-contentTD" style="width: 22%">${cxGrade2}</td>
					<td class="table-titleTD" style="width: 12%"></td>
					<td class="table-contentTD" style="width: 22%"></td>
				</tr>
				<tr>
					<td class="table-titleTD">学年学习情况：</td>
					<td colspan="5"><%@ include file="/module/studentCourse.jsp"%>
					</td>
				</tr>
				<tr>
					<td class="table-titleTD">获奖情况：</td>
					<td colspan="5" class="table-contentTD"><textarea id="hjqk"
							name="hjqk" style="width: 90%; height: 80px;" disabled="disabled">${scholarshipApply.hjqk}</textarea>
					</td>
				</tr>
				<tr>
					<td class="table-titleTD"></td>
					<td colspan="5" class="table-contentTD"><textarea id="sqly"
							name="sqly" style="width: 90%; height: 80px;" disabled="disabled">${scholarshipApply.sqly}</textarea>
					</td>
				</tr>
			</table>
			<br/>
			<table cellpadding="0" cellspacing="0" border="0"
				class="table-border" width="95%">
				<tr>
					<c:if test="${checkFlag==1}">
						<td class="table-titleTD" style="13%">审批意见：</td>
						<td class="table-contentTD"  colspan="5" style="border: 0;"><input
							type="text" id="spyj" name="spyj" value="" class="inputText" autocomplete="off"
							style="width: 50%" />&nbsp;&nbsp; 审批结果：<input type="radio"
							id="states" name="states" value="3" checked="checked" />审核通过&nbsp;&nbsp;<input
							type="radio" id="states" name="states" value="1" />拒绝
							&nbsp;&nbsp;<input type="button" id="btnSave" class="inputButton"
							style="text-align: center;" value="完成审批" />&nbsp;&nbsp; <input
							type="button" id="btnBack" autocomplete="off" class="inputButton"
							value="返回" style="text-align: center;" /></td>
					</c:if>
				</tr>

				<tr>
					<td class="table-titleTD" style="text-align: center;">序号</td>
					<td class="table-titleTD" style="text-align: center;">审批人</td>
					<td class="table-titleTD" style="text-align: center;">审批步骤</td>
					<td class="table-titleTD" style="text-align: center;">审批结果</td>
					<td class="table-titleTD" style="text-align: center;">审批时间</td>
					<td class="table-titleTD" style="text-align: center;">审批意见</td>
				</tr>
				<c:forEach items="${chekResultList}" var="res" varStatus="status">
					<tr>
						<td class="table-contentTD" style="text-align: center;">${status.index+1}</td>
						<td class="table-contentTD" style="text-align: center;">${res.userName}</td>
						<td class="table-contentTD" style="text-align: center;">${res.stepName}</td>
						<td class="table-contentTD" style="text-align: center;">${res.userState}</td>
						<td class="table-contentTD" style="text-align: center;">${res.approvalTime}</td>
						<td class="table-contentTD" style="text-align: center;">${res.comments}</td>
					</tr>
				</c:forEach>
			</table>
			<br/>
			<c:if test="${checkFlag==0}">
				<table cellpadding="0" cellspacing="0" border="0"
					align="left">
					<tr>
						<td><input
							type="button" id="btnBack" autocomplete="off" class="inputButton"
							value="返回" style="text-align: center;" /></td>
					</tr>
				</table>
			</c:if>
		</div>
	</form>
</body>
<script type="text/javascript">
	if ("${msg}" != "") {
		layer.alert("${msg}", {
			icon : 6
		});
	}
</script>
</html>
